
private ["_display", "_dikCode", "_shift", "_control", "_alt", "_handled"];

_display 	= _this select 0;
_dikCode 	= _this select 1;
_shift 		= _this select 2;
_control 	= _this select 3;
_alt 		= _this select 4;

_handled 	= false;

	if (_dikCode == 210) then 
	{	
		// hintSilent str(player getVariable "TES_On_Train");
		if ((player getVariable "TES_On_Train")) then 
		{	
			// titleText ["Get Out","BLACK FADED", 0.2];
			detach player;
			hint "\nYou are free to go!\n\n";
			player setVariable ["TES_On_Train", false, true];
			(findDisplay 46) displayRemoveAllEventHandlers "keyDown";
			(findDisplay 46) displayRemoveAllEventHandlers "MouseMoving";
			_handled = true;
		};
	};
	if (_dikCode in (actionKeys "AimLeft")) then {
		player setDir (getDir player ) - 2;
		_handled = true;
	};
	if (_dikCode in (actionKeys "AimRight")) then {
		player setDir (getDir player ) + 2;
		_handled = true;
	};

_handled